﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Meqs.Entity
{
    /// <summary>
    /// 评语
    /// </summary>
    [Serializable]
    public class Appraisals : BaseMultiUser
    {
        private int _rID;
        private double _min;
        private double _max;
        private string _context;
        private int _elID;

        public Appraisals()
        {
        }

        public Appraisals(int rID, double min, double max, string context, int elID)
        {
            _rID = rID;
            _min = min;
            _max = max;
            _context = context;
            _elID = elID;
        }

        /// <summary>
        /// ID
        /// </summary>
        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        /// <summary>
        /// 分值下限
        /// </summary>
        public double Min
        {
            get { return _min; }
            set { _min = value; }
        }

        /// <summary>
        /// 分值上限
        /// </summary>
        public double Max
        {
            get { return _max; }
            set { _max = value; }
        }

        /// <summary>
        /// 评语内容
        /// </summary>
        public string Context
        {
            get { return _context; }
            set { _context = value; }
        }

        /// <summary>
        /// 评估项ID
        /// </summary>
        public int ElID
        {
            get { return _elID; }
            set { _elID = value; }
        }

        public bool Equals(Appraisals other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (Appraisals)) return false;
            return Equals((Appraisals) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
